import axios from './$http'


const cache = new Map();

const api = {
    clearCache() {
        cache.clear();
    },
    async querySettleRecord(data) {
        const result = await axios.post("/hbos-business-charge-gydfy/charge/settleBillRecord",
            {
                "serviceItemCategory": "",
                "refundStatus": "",
                "startDate": data.startDate,
                "endDate": data.endDate,
                "patientId": data.patientId
            });
        return result;
    },
    async queryResidentOrgRegistInfo(medicalRecordNo) {
        const result = await axios.post("/hbos-rhc/residentOrg/queryResidentOrgRegistInfo",
            {
                "cardId": "200001",
                "residentCardNo": medicalRecordNo
            });
        return result;
    },
    async getBillBySettleBillId(settleBillId) {
        const result = await axios.post("/hbos-business-charge-gydfy/bill/getBillBySettleBillId",
            {
                "orgId": "20001001",
                "settleBillId": settleBillId
            });
        return result;
    },
    async reOpenInvoice(billId) {
        const result = await axios.post("/hbos-stc/einvoice/test/createInvoiceByTargetIdList",
            {
                "targetIdList": [
                    billId
                ],
                "targetType": "BILL"
            });
        return result;
    }
}

export default api;